Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Create formatter for GitHub Actions #746

Merged
merged 1 commit into from
May 25, 2024

Conversation

Iron-Ham
Copy link
Contributor

@Iron-Ham Iron-Ham commented May 22, 2024

This pull request adds a formatter for use with GitHub Actions.

The output of this formatter is meant to work as an actions annotation, as per the Actions Docs.

For example, if I had a file within my Utilities module that had an unused function, it would be output this way:

::warning file=Modules/Utilities/Sources/Utility/Sequence+Contains.swift,line=13,col=10,title=unused::Function 'containsNone(_:)' is unused

Usage

$ periphery scan --relative-results --format actions

Note

Failure to specify --relative-results will result in a usage error being thrown instructing the user to use --relative-results. GitHub Actions specifically wants relative paths.

When used in CI, we get results directly on pull requests.

Screenshot 2024-05-22 at 12 14 28 PM

New class and methods:

Enum extension:

@ileitch ileitch merged commit 47cf15b into peripheryapp:master May 25, 2024
6 checks passed
@ileitch
Copy link
Contributor

ileitch commented May 25, 2024

Many thanks for this! I renamed the format to github-actions as actions by itself may be ambiguous.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants